﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace Xna_Shootr
{
    class SimpleBullet : Bullet
    {
        private float viMagnitude = 10.0f; // initial velocity magnitude

        public SimpleBullet(Texture2D sprite)
            : base(sprite)
        {            
        }

        public SimpleBullet(Texture2D sprite, Vector2 position, Vector2 unitVelocityVector, bool alive) : this(sprite)
        {
            this.position = position;
            this.velocity = unitVelocityVector * viMagnitude;
            this.alive = alive;
        }

        public override void Draw(SpriteBatch spriteBatch)
        {
            if (alive)
            {
                spriteBatch.Draw(sprite, position, Color.White);
            }
        }

        public override void Push(Vector2 acceleration)
        {
            // simple bullet do not support push, do nothing here
        }

    }
}
